package com.zlp.redis.controller;


import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
/**
 * @author: zhulaiping
 * @time: 2022/7/22 10:40
 */
public class RedisController {

    @Autowired
    Redisson redisson;

    @GetMapping("/redis")
    public String getString(){
        RLock lock = redisson.getLock("aaaa");
        lock.lock();
        lock.unlock();
        return "11111";
    }
}
